﻿@model StoreModel
@using Nop.Core.Domain.Media
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    Html.AddTitleParts(!String.IsNullOrEmpty(Model.MetaTitle) ? Model.MetaTitle : Model.Name);
    Html.AddMetaDescriptionParts(Model.MetaDescription);
    Html.AddMetaKeywordParts(Model.MetaKeywords);

    var canonicalUrlsEnabled = EngineContext.Current.Resolve<Nop.Core.Domain.Seo.SeoSettings>().CanonicalUrlsEnabled;
    if (canonicalUrlsEnabled)
    {
        var storeUrl = Url.RouteUrl("Store", new { storeId = Model.Id, SeName = Model.SeName }, this.Request.Url.Scheme);
        Html.AddCanonicalUrlParts(storeUrl);
    }
    var i = 0;
    var r = 0;
}
@using Nop.Core;
@using Nop.Core.Domain.Common;
@using Nop.Core.Infrastructure;
@using Nop.Web;
@using Nop.Web.Framework.UI;
@using Nop.Web.Models.Catalog;
@using Nop.Web.Extensions;
<div class="store-page">
    <div class="store-header">
        <div class="breadcrumb">
            <ul>
                <li><a href="/">Top</a> <span class="delimiter">/</span></li>
                <li><strong><a href="@Model.StoreLink">@Model.Name</a></strong></li>
            </ul>
        </div>
    </div>
    <div class="sh-top-content">
        <div class="store-description">

            <h1 class="section-title">
                @Model.Name
            </h1>
            <div class="window-title-links hide">
                @Html.ActionLink("Store Policy", "StoreAll", new { }, new { @class="button-grey"})
            </div>
            @Html.Raw(Model.Description)

            <div class="store-rating">
                @Html.Action("StoreRating", "Catalog", new { area = "Commerce", currentStoreId = Model.Id })
            </div>
        </div>
    </div>

    @*filtering
    @if (Model.PagingFilteringContext.PriceRangeFilter.Enabled)
    {
        <div class="product-filters">
            <div class="filter-title">
                <span>@T("Filtering.FilterResults")</span>
            </div>
            <div class="filter-item">
                @Html.Partial("_FilterPriceBox", Model.PagingFilteringContext.PriceRangeFilter, new ViewDataDictionary())
            </div>
        </div>
        <div class="clear">
        </div>
    }*@

    <div class="clear-block">

    @*product list*@
    @if (Model.Products.Count > 0)
    {
        <div class="store-products">
            <h2 class="underline">Products from @Model.Name</h2>
            
            <ul class="unordereddata">
                @foreach (var product in Model.Products)
                {
                    i++;
                    r = i % 4;
                    if (r == 0) {
                        r = 4;
                    }
                    <li class="item-@i col-@r"><div class="panel-small panel">
                        @Html.Partial("_CustomProductBox", product)
                    </div></li>
                }
            </ul>
            <div class="content-clear"></div>
            @if (Model.Products.Count > 8)
            {
                <div class="more-products">
                    <a href="/search?Store.Id=@Model.Id" class="button-grey">See More Products</a>
                </div>
            }
        </div>
            
    }
    
    
    @*TODO allow customer to select page size*@
    @*
    <div class="pager">
    @Html.Pager(Model.PagingFilteringContext).QueryParam("pagenumber")
    </div>
    


    @Html.Action("StoreLocationFrontPageInfo", "Catalog", new { area = "Commerce", currentStoreId = Model.Id })
    *@
    </div>
</div>
